﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication2
{
    public partial class AdminAddGradeMarks : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        private void AddSubject()
        {

            Label type = new Label();
            type.Width = 100;
            type.Height = 15;
            type.Text = "TYPE";
            type.Font.Bold = true;


            Label mark = new Label();
            mark.Width = 100;
            mark.Height = 15;
            mark.Text = "MARK";
            mark.Font.Bold = true;
         


            Label outof = new Label();
            outof.Width = 100;
            outof.Height = 15;
            outof.Text = "OUT OF";
            outof.Font.Bold = true;
 

            TableRow row0 = new TableRow();
            TableCell cell0_1 = new TableCell();
            TableCell cell0_2 = new TableCell();
            TableCell cell0_3 = new TableCell();

            cell0_1.Controls.Add(type);
            cell0_2.Controls.Add(mark);
            cell0_3.Controls.Add(outof);

            row0.Cells.Add(cell0_1);
            row0.Cells.Add(cell0_2);
            row0.Cells.Add(cell0_3);

            Table1.Rows.Add(row0);

           row0 = new TableRow();
           cell0_1 = new TableCell();
           cell0_2 = new TableCell();
           cell0_3 = new TableCell();


            cell0_1.Text = " ";
            cell0_2.Text = " ";
            cell0_3.Text = " ";

            row0.Cells.Add(cell0_1);
            row0.Cells.Add(cell0_2);
            row0.Cells.Add(cell0_3);

            Table1.Rows.Add(row0);


            for (int i = 0; i < 5; i++)
            {
                TableRow row1 = new TableRow();
                TableCell cell1 = new TableCell();
                TableCell cell2 = new TableCell();
                TableCell cell3 = new TableCell();

                Label l = new Label();
                l.Width = 100;
                l.Height = 15;
                l.Text = "ASSIGNMENT " + i;

                Label l2 = new Label();
                l2.Width = 100;
                l2.Height = 15;
                l2.Text = "MARK " + i;


                TextBox t = new TextBox();
                t.Width = 100;
                t.Height = 15;

      

                cell1.Controls.Add(l);
                cell2.Controls.Add(t);
                cell3.Controls.Add(l2);

                row1.Cells.Add(cell1);
                row1.Cells.Add(cell2);
                row1.Cells.Add(cell3);

                Table1.Rows.Add(row1);



            }
        }
        protected void Button2_Click(object sender, EventArgs e)
        {
            AddSubject();
        }
    }
}